package day2;

/**
 * @author oldliu
 * @since 1.0
 */
public class StringTest4 {
    public static void main(String[] args) {
        //substring
        String str="朱学峰 is a big shuaige";
        String s1 = str.substring(4);
        System.out.println(s1);
        String s2 = str.substring(4,10);//10-4=6
        System.out.println(s2);
        System.out.println(">>>>>>>>>>>>>>>>>>>>");
        //int p1 = str.indexOf(21016);
        int p1 = str.indexOf('学',4);
        System.out.println(p1);
        int p2 = str.indexOf("shuai");
        if(p2<0){
            System.out.println("没有");
        }else{
            System.out.println(p2);
        }

        int p3=str.indexOf("a");
        System.out.println(p3);
        int p4=str.lastIndexOf("a");
        System.out.println(p4);
    }
}
